import time
import unittest
from Po163_0904.Page import Page
from Po163_0904.Page2 import Page2
from selenium.webdriver.common.by import By
from selenium import webdriver
import yaml,logging
from ddt import ddt,file_data

@ddt()
class Test_Jiuxian(unittest.TestCase):

    def setUp(self)->None:
        self.driver=webdriver.Edge()
        self.driver.maximize_window()

    def tearDown(self)->None:
        time.sleep(3)
        self.driver.quit()
    @file_data(r'D:\gao1\PythonProject4\Po163_0904\yaml163.yaml')
    def test_163_login(self,username,password):
        logging.info('---------start case-----------')
        po=Page(self.driver)
        # po.luoji_163_01(username=username,password=password)
        po.open_url('https://mail.163.com/')
        time.sleep(5)
        po.kj()
        # time.sleep(8)
        # po.dy()
        # assert "账号登录" == po.dy()
        po.username(username)
        po.password(password)
        po.login()
        logging.info('---------start case-----------'

if __name__ == '__main__':
    unittest.main()